Skip to content

Piano#2

Merged
meloalright merged 29 commits intodevfrom
piano
Mar 26, 2026
Merged

Piano#2
meloalright merged 29 commits intodevfrom
piano

Conversation

@meloalright
Copy link
Copy Markdown
Member

No description provided.

meloalright and others added 4 commits March 25, 2026 16:56
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Wrap Mixer in Mutex for proper synchronization
- Wrap AudioManager in Arc<Mutex<_>> for safe multi-threaded access
- This fixes potential race conditions when play_note is called

Co-authored-by: 🦞 <🦞@ubuntu>
- Add BlockKeyNote enum with C4-E5 notes mapped to QWERTYUIOP keys
- Generate 500ms sine wave WAV for each note via rodio
- Add BlockKeyState for key debounce
- Integrate into main.rs for guest piano mode
- Update spec documentation

Co-authored-by: Claude <claude@ubuntu>
Co-authored-by: OpenClaw <openclaw@ubuntu>
- Changed from OutputStreamBuilder::open_default_stream to OutputStream::try_default
- Removed thread spawned for audio stream since we can use try_default directly
- Simplified AudioManager to hold OutputStream directly
- Changed MANAGER from Lazy<Option<Arc<Mutex<...>>>> to Lazy<Arc<Mutex<_>>>
- Spawn a dedicated thread that owns the OutputStream (which is not Send/Sync on macOS)
- Communicate with audio commands via mpsc channel
- Reads sample files and sends to audio thread instead of storing file paths
- Removed static AudioManager that caused Send trait issues with CoreAudio

This approach is similar to how block_key.rs already works and avoids
the macOS-specific issue where OutputStream contains non-Send types.
- Changed status from 'Not implemented' to 'Implemented in src/piano.rs'
- Added macOS compatibility fix notes

Co-authored-by: 🦞 <🦞@ubuntu>
meloalright and others added 7 commits March 26, 2026 04:15
- Rodio is used by block_key.rs which is not feature-gated
- CI build fails without rodio because it's not linked
- Make rodio always available, remove from interactive feature

Co-authored-by: 🦞 <🦞@ubuntu>
- rodio requires alsa-sys which needs libasound2-dev
- Install ALSA dev libs before building

Co-authored-by: 🦞 <🦞@ubuntu>
- All jobs that use rodio need libasound2-dev
- Added ALSA install to clippy, test, and nightly jobs

Co-authored-by: 🦞 <🦞@ubuntu>
- Made rodio an optional dependency with minimp3 feature
- Wrapped all audio code in block_key.rs behind #[cfg(feature = interactive)]
- CI builds now use --no-default-features for headless builds
- Tests still pass with --all-features

Co-authored-by: 🦞 <🦞@ubuntu>
Co-authored-by: Melo <5381032473@telegram>

Co-authored-by: OpenClaw <support@openclaw.dev>
Laze and others added 3 commits March 26, 2026 17:50
- Q, W, E, R, T play black keys (C#, D#, F#, G#, A#)

- Y, U, I, O, P produce no sound

- Uses shared OutputStream to prevent audio warnings

Co-authored-by: Melo <5381032473@telegram>

Co-authored-by: OpenClaw <support@openclaw.dev>
Laze and others added 6 commits March 26, 2026 18:10
- Lower Octave (Z-M): C3-B3

- Middle Octave (A-J): C4-B4

- Upper Octave (Q-U): C5-B5

All use PianoNote system with correct sample files and playback speeds

Co-authored-by: Melo <5381032473@telegram>

Co-authored-by: OpenClaw <support@openclaw.dev>
@meloalright meloalright merged commit 6489026 into dev Mar 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant